package com.soap.desensitize.posterity.json;

import com.soap.desensitize.encry.IDesensitization;
import com.soap.desensitize.exception.strategy.DecodeException;
import com.soap.desensitize.exception.strategy.EncodeException;

/**
 * @desc	加密解密核心配置类
 * @author 	Administrator
 * @time	2022-04-21
 */
public abstract class AbstractJsonPosterity<T> {
    protected IDesensitization encry;

    /**
     * @desc 有参构造器
     * @param encry
     */
    public AbstractJsonPosterity(IDesensitization encry) {
        this.encry = encry;
    }


    public abstract String encode(T data) throws EncodeException;

    public abstract T decode(String data,Class cla) throws DecodeException;

    public IDesensitization getEncry() {
        return encry;
    }

    public void setEncry(IDesensitization encry) {
        this.encry = encry;
    }
}
